package com.yangst.service.common.model;

import com.fasterxml.jackson.annotation.JsonIgnore;

import java.io.Serializable;

/**
 * 存放结果实体类
 * Created by YST on 2018/4/13.
 */
public class CommonResult<T> implements Serializable {
    private static final long serialVersionUID = -445589231629791713L;

    public static final int   SUCCESS          = 0;

    private int               status;
    private String            msg;
    private T                 data;

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    /**
     *
     * @return
     */
    @JsonIgnore
    public boolean isSuccess() {
        return getStatus() == SUCCESS;
    }

}
